/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package eeep.beans;

import eeep.entidades.Boletin;
import eeep.entidades.Materia;
import eeep.entidades.Pessoa;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Junior
 */
@ManagedBean(name = "Boletin")
@SessionScoped
public class BoletinBean {
 private double b1;
    private double b2;
    private double b3;
    private double b4;
    private double MF;
    private Pessoa pessoa;
    private Materia materia;
    
    public double getB1() {
        return b1;
    }

    public void setB1(double b1) {
        this.b1 = b1;
    }

    public double getB2() {
        return b2;
    }

    public void setB2(double b2) {
        this.b2 = b2;
    }

    public double getB3() {
        return b3;
    }

    public void setB3(double b3) {
        this.b3 = b3;
    }

    public double getB4() {
        return b4;
    }

    public void setB4(double b4) {
        this.b4 = b4;
    }

    public double getMF() {
        return MF;
    }

    public void setMF(double MF) {
        this.MF = MF;
    }

    public Pessoa getPessoa() {
        return pessoa;
    }

    public void setPessoa(Pessoa pessoa) {
        this.pessoa = pessoa;
    }

    public Materia getMateria() {
        return materia;
    }

    public void setMateria(Materia materia) {
        this.materia = materia;
    }
    Boletin boletin = new Boletin();
    public void salvar(){
         boletin.setB1(b1);
         boletin.setB2(b2);
         boletin.setB3(b3);
         boletin.setB4(b4);
         boletin.setMF(MF);
         boletin.setMateria(materia);
         boletin.setPessoa(pessoa);
//        projeto.setCondigo(condigo);
        HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
        HttpServletRequest request = (HttpServletRequest) req;
        HttpSession session = (HttpSession) request.getSession();
        String login = (String) session.getAttribute("PEGAR_PESSOA");
//        projeto.setIdEmpresa(edao.buscarPorLogin(login));
//        idEmpresa=projeto.getIdEmpresa();
    }
    
    /**
     * Creates a new instance of BoletinBean
     */
    
    
}
